import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Buefy from 'buefy'

import 'bootstrap/dist/css/bootstrap.min.css'

import 'bootstrap/dist/css/bootstrap.css'
import 'jquery/dist/jquery.min'
import 'bootstrap/dist/js/bootstrap.min'
import 'buefy/dist/buefy.css'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/app.css'
import '@/permission'
import relativeTime from 'dayjs/plugin/relativeTime';
import format from 'date-fns/format'
// 国际化
import 'dayjs/locale/zh-cn'
import 'highlight.js/styles/monokai-sublime.css'
import i18n from './i18n/index'
import locale from 'element-ui/lib/locale/lang/en'

Vue.use(ElementUI, { locale })
const dayjs = require('dayjs');

Vue.filter('date', (date) => {
  return format(new Date(date), 'yyyy-MM-dd')
})

// 相对时间插件
dayjs.extend(relativeTime)

dayjs.locale('zh-cn') // use locale globally
dayjs().locale('zh-cn').format() // use locale in a specific instance

Vue.prototype.dayjs = dayjs;//可以全局使用dayjs

Vue.config.productionTip = false

Vue.use(Buefy);
Vue.use(ElementUI);

new Vue({
  i18n,
  router,
  store,
  render: h => h(App)
}).$mount('#app')
